package com.crm.web.page;

import org.apache.tapestry.html.BasePage;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 * @author <a href="mailto:huang0510@hotmail.com">HuangHuang</a>
 * @version $Id$
 */
public abstract class SysPageError extends BasePage {
    private static Log log = LogFactory.getLog(SysPageError.class);

    /**
     * relogin when user session was null
     */
    public void relogin(){
        String staffCode = this.getRequestCycle()
                .getInfrastructure()
                .getCookieSource()
                .readCookieValue("usercode");
        log.info(staffCode
                + " : Relogin because user didn't operated for over twenty minutes and session was null!");
        this.getRequestCycle()
                .sendRedirect("app?page=Home&service=page");
    }
}
